<template>
<div @click="cardClickHandler">
  <img :src="props.img" alt="">
  <span>{{ props.title }}</span>
  <p>{{ props.description }}</p>
  <b >MORE</b>
</div>
</template>
<script setup lang="ts">

const props = defineProps<{
  img: string,
  title: string,
  description: string,
  link: string
}>()

const cardClickHandler = () => {
  window.location.href = props.link
}

</script>
<style scoped>
  div {
    display: inline-block;
    position: relative;
    width: 320px;
    height: 340px;
    white-space: wrap;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;

    &:hover {
      box-shadow: 2px 2px 10px #733;
    }
    img {
      width: 320px;
      height: 150px;
      object-fit: cover;
      border-radius: 10px 10px 0px 0px;

    }
    span {
      display: block;
      width: 90%;
      margin: 0px auto;
      line-height: 50px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    p {
      padding-top: 10px;
      font-size: 14px;
      opacity: .6;
      width: 90%;
      margin: 0 auto;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    b {
      font-size: 12px;
      position: absolute;
      color: #733;
      bottom: 0;
      right: 0;
      padding: 15px;
    }
  }
</style>
